Skip to main content

Import

Usage

Return Type: UseQueryResult<TokenBalance[]>

The hook returns all properties from React Query’s UseQueryResult with token balance data. Here’s the detailed structure:

Properties

data

TokenBalance[] | undefined Array of token balance objects containing:
  • contractType: Type of the token contract (ERC20, ERC721, ERC1155)
  • contractAddress: Address of the token contract
  • accountAddress: Address of the account holding the tokens
  • balance: Token balance as a string (in base units)
  • chainId: Chain ID where the token exists
  • blockHash: Hash of the block where balance was last updated
  • blockNumber: Block number where balance was last updated
  • tokenID: Optional token ID for NFTs
  • contractInfo: Optional token contract information including name, symbol, decimals, and logo URL
  • tokenMetadata: Optional metadata about the token
  • uniqueCollectibles: Number of unique collectibles
  • isSummary: Whether the balance is a summary

isLoading

boolean Loading state for the data fetch.

isError

boolean Error state indicating if the query failed.

error

Error | null Any error that occurred during data fetching.

Parameters

The hook accepts two parameters:

args: GetTokenBalancesByContractArgs

options: BalanceHookOptions